<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // 作业：通过数组解构拿出来这个人的信息（要求用俩变量解构完毕），
      // ['张三',{uname:'张三',age:18,address:'杭州'},{uname:'李四',age:20,address:'上海'}]
      // 通过解构出来的数据第一个名字 找出这个人的全部信息 打印出来

      let arr = [
        '张三',
        { uname: '张三', age: 18, address: '杭州' },
        { uname: '李四', age: 20, address: '上海' },
      ]
      const [a, ...arr1] = arr
      console.log(a)
      // console.log(arr1)
      arr1.map((item) => {
        // console.log(item)
        if (a === item.uname) {
          console.log(item)
        }
      })
    </script>
  </body>
</html>
